#include <iostream>

using namespace std;


int n, k;
int ret;

void dfs(int pos, int begin, int sum)
{
	if(pos > k)
	{
		if(sum == n)
		ret++;
		return;	
	}
	for(int i = begin; i <= n - sum; i++)
	{
		sum += i;
		if((sum + i * (k - pos)) > n) continue;
		dfs(pos + 1, i, sum);
		sum -= i;
	}
}

int main()
{
	cin >> n >> k;
	dfs(1, 1, 0);
	cout << ret << endl;
	return 0;
}
